<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'pembayaran-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        
        <div class="row">
		<?php if(false)echo $form->labelEx($model,'ID_Pembayaran'); ?>
		<?php if(false)echo $form->textField($model,'ID_Pembayaran',array('size'=>20,'maxlength'=>20,'disabled'=>true)); ?>
		<?php if(false)echo $form->error($model,'ID_Pembayaran'); ?>
	</div>

	<div class="row">
		<?php if(false)echo $form->labelEx($model,'Tgl_Pembayaran'); ?>
		<?php if(false)echo $form->textField($model,'Tgl_Pembayaran',array('disabled'=>true)); ?>
		<?php if(false)echo $form->error($model,'Tgl_Pembayaran'); ?>
	</div>

        <?php for($i = 0; $i <= $adds; $i++) :?>

        <div class="row">
		<?php echo $form->labelEx($model2[$i],'['.$i.']ID_Pesanan'); ?>
		<?php echo $form->textField($model2[$i],'['.$i.']ID_Pesanan',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model2[$i],'['.$i.']ID_Pesanan'); ?>
	</div>

        <?php endfor ?>

        <div class ="row">
            <p>
                <?php echo CHtml::Button('Tambah Pesanan', array('submit'=>array('pembayaran/create', 'add'=>$adds + 1, 'ok'=>0))); ?>
                <?php if($adds >0) echo CHtml::Button('Kurangi Pesanan', array('submit'=>array('pembayaran/create', 'add'=>$adds - 1, 'ok'=>0))); ?>
            </p>
        </div>

        <h3>
            <?php if(Yii::app()->user->isMember()){
                    echo 'Saldo Anda : Rp'.(int)Member::model()->findByPk(Yii::app()->user->name)->Saldo.',00';
                  }
            ?>
        </h3>
        
        <div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Bayar' : 'Simpan', array('submit'=>array('pembayaran/create', 'add'=>$adds))); ?>
	</div>

        

<?php $this->endWidget(); ?>

</div><!-- form -->